home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / gcc / ixemsdk.lha / man / cat2 / send.0 < prev    next >
Text File  |  1996-09-01  |  4KB  |  86 lines

  1.  
  2. SEND(2)                    UNIX Programmer's Manual                    SEND(2)
  3.  
  4. NNAAMMEE
  5.      sseenndd, sseennddttoo, sseennddmmssgg - send a message from a socket
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  9.      ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
  10.  
  11.      _s_s_i_z_e___t
  12.      sseenndd(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _s_i_z_e___t _l_e_n, _i_n_t _f_l_a_g_s)
  13.  
  14.      _s_s_i_z_e___t
  15.      sseennddttoo(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _s_i_z_e___t _l_e_n, _i_n_t _f_l_a_g_s,
  16.              _c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_t_o, _i_n_t _t_o_l_e_n)
  17.  
  18.      _s_s_i_z_e___t
  19.      sseennddmmssgg(_i_n_t _s, _c_o_n_s_t _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s)
  20.  
  21. DDEESSCCRRIIPPTTIIOONN
  22.      SSeenndd(), sseennddttoo(), and sseennddmmssgg() are used to transmit a message to another
  23.      socket.  SSeenndd() may be used only when the socket is in a _c_o_n_n_e_c_t_e_d state,
  24.      while sseennddttoo() and sseennddmmssgg() may be used at any time.
  25.  
  26.      The address of the target is given by _t_o with _t_o_l_e_n specifying its size.
  27.      The length of the message is given by _l_e_n. If the message is too long to
  28.      pass atomically through the underlying protocol, the error EMSGSIZE is
  29.      returned, and the message is not transmitted.
  30.  
  31.      No indication of failure to deliver is implicit in a sseenndd().  Locally de-
  32.      tected errors are indicated by a return value of -1.
  33.  
  34.      If no messages space is available at the socket to hold the message to be
  35.      transmitted, then sseenndd() normally blocks, unless the socket has been
  36.      placed in non-blocking I/O mode.  The select(2) call may be used to de-
  37.      termine when it is possible to send more data.
  38.  
  39.      The _f_l_a_g_s parameter may include one or more of the following:
  40.  
  41.      #define MSG_OOB        0x1  /* process out-of-band data */
  42.      #define MSG_DONTROUTE  0x4  /* bypass routing, use direct interface */
  43.  
  44.      The flag MSG_OOB is used to send ``out-of-band'' data on sockets that
  45.      support this notion (e.g.  SOCK_STREAM); the underlying protocol must al-
  46.      so support ``out-of-band'' data.  MSG_DONTROUTE is usually used only by
  47.      diagnostic or routing programs.
  48.  
  49.      See recv(2) for a description of the _m_s_g_h_d_r structure.
  50.  
  51. RREETTUURRNN VVAALLUUEESS
  52.      The call returns the number of characters sent, or -1 if an error oc-
  53.      curred.
  54.  
  55. EERRRROORRSS
  56.      SSeenndd(), sseennddttoo(), and sseennddmmssgg() fail if:
  57.  
  58.      [EBADF]       An invalid descriptor was specified.
  59.  
  60.      [ENOTSOCK]    The argument _s is not a socket.
  61.  
  62.      [EFAULT]      An invalid user space address was specified for a parame-
  63.                    ter.
  64.  
  65.      [EMSGSIZE]    The socket requires that message be sent atomically, and
  66.  
  67.                    the size of the message to be sent made this impossible.
  68.  
  69.      [EAGAIN]      The socket is marked non-blocking and the requested opera-
  70.                    tion would block.
  71.  
  72.      [ENOBUFS]     The system was unable to allocate an internal buffer.  The
  73.                    operation may succeed when buffers become available.
  74.  
  75.      [ENOBUFS]     The output queue for a network interface was full.  This
  76.                    generally indicates that the interface has stopped sending,
  77.                    but may be caused by transient congestion.
  78.  
  79. SSEEEE AALLSSOO
  80.      fcntl(2),  recv(2),  select(2),  getsockopt(2),  socket(2),  write(2)
  81.  
  82. HHIISSTTOORRYY
  83.      The sseenndd() function call appeared in 4.2BSD.
  84.  
  85. 4.2 Berkeley Distribution      February 21, 1994                             2
  86.